package com.DreamForce.Demo.persist.IbatisImpl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.DreamForce.demo.model.Category;
import com.DreamForce.Demo.persist.DAO.CategoryMapper;
@Service
public class CategoryHandler {
	protected static Logger logger = Logger.getLogger(CategoryHandler.class);
	
	@Autowired
	private CategoryMapper categoryMapper;
	
    public List<Category> getCategories()
    {
    	List<Category> list;
    	try
    	{
    		list = categoryMapper.getCategoryList();
    	}
    	catch(Exception e)
    	{
    		return null;
    	}
		return list;
    }
    public Category getCategory(String categoryId)
    {
    	Category category;
    	try
    	{
    		category = categoryMapper.getCategory(categoryId);
    	}
    	catch(Exception e)
    	{
    		return null;
    	}
		return category;
    }
   
    
}
